package com.louis.mail;

import org.springframework.core.io.ByteArrayResource;
import org.springframework.core.io.InputStreamSource;

/**
 * 
 * <p>
 * ByteArrayAttachment
 * </p>
 * 
 * @author louis
 * @DateTime Jul 29, 2011 3:24:15 PM
 * @version 1.0.0
 */
public class ByteArrayAttachment implements Attachment {
	private String name;
	private byte[] bytes;

	public ByteArrayAttachment(String name, byte[] bytes) {
		this.name = name;
		this.bytes = bytes;
	}

	public String getAttachmentName() {
		return name;
	}

	public InputStreamSource getInputStreamSource() {
		return new ByteArrayResource(bytes);
	}
}